package com.LeeCode;

/**
 * 4的幂
 */

public class Code342 {
    public static void main(String[] args) {
        System.out.println(new Code342().isPowerOfFour(4));
    }

    public boolean isPowerOfFour(int n) {
        return n > 0 && (n & (n - 1)) == 0 && ((n & 0x55555555) > 0);
    }
}
